package kr.co.icebird.spring3.app.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import kr.co.icebird.spring3.app.service.MemberService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class JQueryController {

	@Autowired
	MemberService memberService;

	@RequestMapping("/jquery/list")
	public ModelAndView jtest01(HttpServletRequest request,
			HttpServletResponse response) {

		return new ModelAndView("/jquery/jtest01", "mList",
				memberService.getMemberList());
	}
	
	@RequestMapping("/jquery/user/{id}")
	public ModelAndView jtest02(@PathVariable("id") Long id){
		return new ModelAndView("/jquery/jtest02", "member",
				memberService.getMember(id));
	}
}
